package top.aigoo.project01.entity.dto;

import top.aigoo.project01.entity.Shop;
import top.aigoo.project01.enums.ShopStateEnum;

import java.util.List;

/**
 * @Description: 封装执行后结果
 * @Author: Mr.OYSHUO.欧阳大叔  mail:1642302522@qq.com
 * @Version 1.0.0
 * @Date: 2021/8/9 0:10
 */
public class ShopExecution {
    // state
    private int state;
    // 结果stateInfo
    private String stateInfo;
    // 店铺数量
    private int count;

    //操作的店铺(增、删、改店铺的时候用到)
    private Shop shop;

    // shop列表(查询店铺列表的时候使用）
    private List<Shop> shopList;

    public ShopExecution() {
    }

    /**
     * 店铺操作失败使用的构造器
     */
    public ShopExecution(ShopStateEnum stateEnum) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    /**
     * 店铺操作(增删改)成功使用的构造器
     */
    public ShopExecution(ShopStateEnum stateEnum, Shop shop) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.shop = shop;
    }

    /**
     * 店铺操作(查找)成功使用的构造器
     */
    public ShopExecution(ShopStateEnum stateEnum, List<Shop> shopList) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.shopList = shopList;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Shop getShop() {
        return shop;
    }

    public void setShop(Shop shop) {
        this.shop = shop;
    }

    public List<Shop> getShopList() {
        return shopList;
    }

    public void setShopList(List<Shop> shopList) {
        this.shopList = shopList;
    }
}
